package com.tianxin.workbao.workBao.utils.common;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by hacker on 2017/8/2.
 */

public class StringUtils {

    public static boolean isHasChineseChar(String string) {
        Pattern pattern = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher m = pattern.matcher(string);
        if (m.find()) {
            return true;
        }
        return false;
    }

    public static boolean isNumber(String string) {
        String reg = "^\\d+$";
        if (string.matches(reg)) {
            return true;
        }
        return false;
    }

    public static boolean isPlateNumber(String string) {
        String reg = "^[\u4E00-\u9FA5][A-Z][A-Z0-9]{5}$";
        if (string.matches(reg)) {
            return true;
        }
        return false;
    }

    public static boolean isLatter(String string) {
        String reg = "^[A-Za-z]+$";
        if (string.matches(reg)) {
            return true;
        }
        return false;
    }


}
